﻿using ACC.Business;
using ACC.Business.Stn;
using ACC.Business.Utils;
using ACC.Data;
using ACC.Data.Comm;
using ACC.Data.Line;
using ACC.Device;
using ACC.LineDevice.KukaPack;
using System;

namespace Script
{
    /// <summary>
    /// pack转运， 取消？
    /// 之前是因为12030的测重不能用 加了12070来手动测
    /// </summary>
    class L1P12071 : StnProcessKukaPack
    {
        public L1P12071(StnRunningData data)
            : base(data)
        {
        }

        protected override void CreateBusinessLogic()
        {
            base.CreateBusinessLogic();
            _loadProcess = new LoadFromTest(_data);
        }

        protected override ACCDevice CreateDevice()
        {
            ACCDevice dev = base.CreateDevice();
            if (kukaSiemensDev != null)
            {
                kukaSiemensDev.DB190 = 800;
                kukaSiemensDev.DB190_Offset = 15000;
                kukaSiemensDev.DB192 = 80;
                kukaSiemensDev.DB192_PLC_Offset = 15066;

                kukaSiemensDev.DB193 = 800;
                kukaSiemensDev.DB193_PLC_Offset = 15034;
                kukaSiemensDev.DB193_ACC_Offset = 15068;
                kukaSiemensDev.DB194 = 800;
                kukaSiemensDev.DB194_PLC_Offset = 15034;
                kukaSiemensDev.DB194_PLC_Data_Offset = 15078;
            }

            return dev;

        }

        public override ACCCode ReadLoadParam(ACCDevice dev, out ACCDevice.LoadParam param)
        {
            ACCCode rs = base.ReadLoadParam(dev, out param);
            rs = ACCCode.ACCInternalError;

            return rs;
        }
    }
}
